home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / asm106.zip / ASM.TXT < prev    next >
Text File  |  1995-11-17  |  6KB  |  118 lines

  1. Magic Assembler v1.06 - Documentation
  2. ═══════════════════════════════════════════════════════════════════════════════
  3. Changes since version 1.051:
  4. - LEA command added
  5. - binary and decimal number recognation added
  6. - example programs added
  7. - remark bug fixed
  8. - standard numbers added
  9. - comma acception in DB and DW functions added
  10. - EQU command improved
  11. ═══════════════════════════════════════════════════════════════════════════════
  12. Magic Assembler is a public domain assembly language compiler, which can
  13. produce as well as COM files as boot sector programs. Compiling to COM files
  14. can be done using the following command line:
  15. ┌────────────────┐
  16. │ ASM MYPROG.ASM │
  17. └────────────────┘
  18. To put the program in the boot sector of a disk which is in drive A, the use 
  19. this command line:
  20. ┌────────────────────┐
  21. │ ASM MYPROG.ASM B:A │
  22. └────────────────────┘
  23. Note that if you want to make a boot program, you should include a code like
  24. this:
  25. ┌─────────────────────────┐
  26. │         mov     ax,07c0 │
  27. │         mov     ds,ax   │
  28. │         mov     es,ax   │
  29. │         mov     ss,ax   │
  30. └─────────────────────────┘
  31. This is because DOS isn't loaded, so DOS cannot do the correct memory settings
  32. before running the program. All bootsector programs are loaded at 07c0:0000, so
  33. that's why this code should be included.
  34. If you want to compile a program and print the source with the right adresses,
  35. use the 'P' parameter:
  36. ┌──────────────────┐
  37. │ ASM MYPROG.ASM P │
  38. └──────────────────┘
  39. This can also be done with a boot sector program, then the command line could
  40. be for example this:
  41. ┌─────────────────────┐
  42. │ ASM MYPROG.ASM B:AP │
  43. └─────────────────────┘
  44. ═══════════════════════════════════════════════════════════════════════════════
  45. The commands included with this assembler are the standard assembly commands,
  46. but there are some exeptions. There are three different JMP commands, and two
  47. different CALL commands. Below the difference are discussed:
  48.  
  49. JMPS    jumps 128 bytes back to 127 bytes further, and uses 2 bytes of code.
  50. JMP     jumps 32768 bytes back to 32767 bytes further, and uses 3 bytes of 
  51.         code.
  52. JMPF    jumps to every possible place in the low memory, and uses 5 bytes of 
  53.         code.
  54. CALL    see JMP, but with this the RET function can be used.
  55. CALLF   see JMPF, but with this the RET function can be used.
  56. ═══════════════════════════════════════════════════════════════════════════════
  57. Variables can be declared with the following functions:
  58.  
  59. DB      byte(s)         declares a byte, but can also be used to declare 
  60.                         multiple bytes.
  61. DW      word(s)         declares a word, but can also be used to declare 
  62.                         mutiple words.
  63. DS      x bytes         declares a free array of x bytes.
  64. DBE     filename.ext    this function puts a file in the compiled version, 
  65.                         supposing that the file is build of bytes.
  66. DWE     filename.ext    this function puts a file in the compiled version, 
  67.                         supposing that the file is build of words.
  68.  
  69. With DB and DW you can also put a ? instead of a value.
  70. If you want to declare data, for which only space in memory must be reserved,
  71. but no space on disk, you should put them on the end of the source. Before you
  72. declare that data you must put an empty line before them, containing only a '-'
  73. at the first place. See the example programs for details.
  74. ═══════════════════════════════════════════════════════════════════════════════
  75. You do not need to tell the assembler that a procedure is a procedure, so you
  76. can declare a procedure like this:
  77. ┌─────────────────────────┐
  78. │ cls     mov     ax,0003 │
  79. │         int     10      │
  80. │         ret             │
  81. └─────────────────────────┘
  82. You can then in the program put the line
  83. ┌─────────────────────┐
  84. │         call    cls │
  85. └─────────────────────┘
  86. ═══════════════════════════════════════════════════════════════════════════════
  87. Standard, all numbers must be in hexadecimal. But, it is possible to work with
  88. binary and decimal numbers too: just put '%b' before the binary number or '%d'
  89. before the decimal number. For example: these three commands have exactly the
  90. same meaning:
  91. ┌──────────────────────────────────────┐
  92. │        mov     ax,4c00               │
  93. │        mov     ax,%d19456            │
  94. │        mov     ax,%b0100110000000000 │
  95. └──────────────────────────────────────┘
  96. ═══════════════════════════════════════════════════════════════════════════════
  97. It is also possible to write the numbers in a standard form, which is used by 
  98. most other assemblers. When you want so, you should add an 'n' as the parameter
  99. to the compiler:
  100. ┌──────────────────┐
  101. │ ASM MYPROG.ASM N │
  102. └──────────────────┘
  103. If you want to use this mode, you should put an 'h' behind an hexadecimal 
  104. number, and a 'b' behind binary numbers. For example: these three commands have
  105. exactly have the same meaning:
  106. ┌──────────────────────────────────────┐
  107. │        mov     ax,4c00h              │
  108. │        mov     ax,19456              │
  109. │        mov     ax,0100110000000000b  │
  110. └──────────────────────────────────────┘
  111. ═══════════════════════════════════════════════════════════════════════════════
  112. I hope you'll enjoy the Magic Assembler. If you have any questions or remarks
  113. about the assembler, the documenation or the sample programs, you can write me
  114. on E-mail bert.greevenbosch@mmm.xs4all.nl
  115. ═══════════════════════════════════════════════════════════════════════════════
  116. Magic Assembler was written by Bert Greevenbosch for Magic Software.
  117. Program created in Rotterdam, the Netherlands.
  118.